package cn.com.zal.cgweb.pojo;

/**
 * TcCartId entity. @author MyEclipse Persistence Tools
 */

public class TcCartId implements java.io.Serializable {

	// Fields

	private Long userId;
	private Long productId;

	// Constructors

	/** default constructor */
	public TcCartId() {
	}

	/** full constructor */
	public TcCartId(Long userId, Long productId) {
		this.userId = userId;
		this.productId = productId;
	}

	// Property accessors

	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	
	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TcCartId))
			return false;
		TcCartId castOther = (TcCartId) other;

		return ((this.getUserId() == castOther.getUserId()) || (this
				.getUserId() != null
				&& castOther.getUserId() != null && this.getUserId().equals(
				castOther.getUserId())))
				&& ((this.getProductId() == castOther.getProductId()) || (this.getProductId() != null
						&& castOther.getProductId() != null && this.getProductId().equals(
						castOther.getProductId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUserId() == null ? 0 : this.getUserId().hashCode());
		result = 37 * result
				+ (getProductId() == null ? 0 : this.getProductId().hashCode());
		return result;
	}

}